#ifndef __TASKQUE_HPP__
#define __TASKQUE_HPP__
#include <memory>
#include <queue>
#include <mutex>
#include <condition_variable>

namespace wd
{
class Task;

using std::shared_ptr;
using std::queue;

using std::mutex;
using std::condition_variable;

using TaskPtr = shared_ptr<Task>;

class TaskQue
{
public:
    TaskQue(size_t);

    void push(TaskPtr);
    TaskPtr pop();

    void wakeup();

    bool empty();
    bool full();
private:


private:
    size_t _taskCapacity;
    queue<TaskPtr> _taskArr;

    bool _exitFlag;

    mutex _mutex;
    condition_variable _notEmpty;
    condition_variable _notFull;
};

}//end of namespace wd


#endif // __TASKQUE_HPP__

